 import {Link,hashHistory} from "react-router";

export default React.createClass({
	getInitialState: function(){
		return {
			styl : {
				display : "block"
			}
		}
	},
    isX : true,
    xian : function(){
    	var obj = document.getElementsByClassName("goods_flex_div")[0]
    	var obj2 =document.getElementById("sanjiao")
    	if(this.isX){
    		obj.style.display = "block"
    		obj2.style.display = "block"
    		this.isX = !this.isX
    	}else{
    		obj.style.display = "none"
    		obj2.style.display = "none"
    		this.isX = !this.isX
    	}
    },
    fan:function(){
    	hashHistory.goBack()
    },
	render : function(){
		 return(
		 	<div>
		 		<div className="goods_header_one" style={this.state.styl2}>
					<Link to="home" className="iconfont goods_header_btn_l icon-shezhi ismi_icon_l"></Link>
					<a href="javascript:;" className="iconfont goods_header_btn_r icon-home_gengduo ismi_icon_r" onClick = {this.xian}></a>
				</div>
				<div className="goods_header_two" style={this.state.styl}>
					<Link className="iconfont goods_header_btn_l2 icon-fanhui" onClick={this.fan}></Link>
					<a href="javascript:;" className="iconfont goods_header_btn_r2 icon-home_gengduo " onClick = {this.xian} ></a>
					<a href="javascript:;" className = "goods_hd_btn_ct isme_hder_btn " id="car_btn">我的购物车</a> 
				</div>
				<ul className="goods_flex_div">
		 			<Link to="home">
		 			<i className="iconfont goods_flex_div_btn icon-shouye"></i>
		 			<span>首页</span>
		 			</Link>
		 			<Link to="home/sousuo">
		 			<i className="iconfont goods_flex_div_btn icon-home_sousuo" ></i>
		 			<span>搜索</span>
		 			</Link>
		 			<Link to="car">
		 			<i className="iconfont goods_flex_div_btn icon-gouwuche1"></i>
		 			<span>购物车</span>
		 			</Link>
		 			<Link to="isme">
		 			<i className="iconfont goods_flex_div_btn icon-wode"></i>
		 			<span>我的</span>
		 			</Link>
		 			<Link >
		 			<i className="iconfont goods_flex_div_btn icon-kefu"></i>
		 			<span>消息</span>
		 			</Link>
		 		</ul>
		 			<div id="sanjiao"></div>
		 	</div>
		 	
		 )
	}
})

